Skip to content

Update vapor/penny-bot #966

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 13, 2025
Merged

Update vapor/penny-bot #966

merged 3 commits into from
Feb 13, 2025

Conversation

MahdiBM
Copy link
Contributor

@MahdiBM MahdiBM commented Jan 16, 2025

Pull Request Description

Replace with a description of this pull request. Instructions for adding
projects are available in the README.

Acceptance Criteria

To be accepted into the Swift source compatibility test suite, a project must:

  • be an Xcode or swift package manager project
  • support building on either Linux or macOS
  • target Linux, macOS, or iOS/tvOS/watchOS device
  • be contained in a publicly accessible git repository
  • maintain a project branch that builds against Swift 4.0 and passes any unit tests
  • have maintainers who will commit to resolve issues in a timely manner
  • be compatible with the latest GM/Beta versions of Xcode and swiftpm
  • add value not already included in the suite
  • be licensed with one of the following permissive licenses:
    • BSD
    • MIT
    • Apache License, version 2.0
    • Eclipse Public License
    • Mozilla Public License (MPL) 1.1
    • MPL 2.0
    • CDDL
  • pass ./project_precommit_check script run

Ensure project meets all listed requirements before submitting a pull request.

projects.json Outdated
Comment on lines 5237 to 5233
"issue": "https://github.com/swiftlang/swift/issues/75499",
"compatibility": ["5.10"],
"branch": ["main", "release/6.0"],
"platform": "Linux",
"job": ["source-compat"]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This issue is actually not the exact issue Penny was having, but i can see why it's linked. The issue Penny was having was both related to a type with Expression in its name, as well as about type ambiguity. But It's still not quite what's in that issue.

Anyway, since I enabled the build_tests_release, I thought i'd need to remove the 5.10 version from compatibility array since I only recently added release-build testing support to Penny (we have CI for it too).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ambiguity problem was quite weird as far as i can remember. When i noticed it, i wasn't sure how the compiler figured out what type to infer in the first place. The type shouldn't have been visible by that file that eventually started throwing errors about ambiguity.

@justice-adams-apple
Copy link
Collaborator

@swift-ci test

@MahdiBM
Copy link
Contributor Author

MahdiBM commented Jan 24, 2025

I can't find a penny-related failure. It appears swift-testing failed with errors like this:

/Users/ec2-user/jenkins/workspace-private/swift-PR-source-compat-suite-test-macOS/swift-testing/Sources/Testing/Expectations/Expectation+Macro.swift:292:40: warning: external macro implementation type 'TestingMacros.ExpectMacro' could not be found for macro 'expect(throws:_:sourceLocation:performing:)'; plugin for module 'TestingMacros' not found
290 | /// ``expect(throws:_:sourceLocation:performing:)-1hfms`` instead.
291 | @discardableResult
292 | @freestanding(expression) public macro expect<E, R>(
    |                                        `- warning: external macro implementation type 'TestingMacros.ExpectMacro' could not be found for macro 'expect(throws:_:sourceLocation:performing:)'; plugin for module 'TestingMacros' not found
293 |   throws error: E,
294 |   _ comment: @autoclosure () -> Comment? = nil,

might need to wait for the other PR to be merged.

@MahdiBM
Copy link
Contributor Author

MahdiBM commented Jan 29, 2025

@justice-adams-apple please retry 🙂

@justice-adams-apple
Copy link
Collaborator

@swift-ci test

@justice-adams-apple
Copy link
Collaborator

@MahdiBM Seeing - error: @_unsafeInheritExecutor attribute is deprecated; consider an 'isolated' parameter defaulted to '#isolation' instead

https://ci.swift.org/job/swift-PR-source-compat-suite-test-macOS/319/artifact/swift-source-compat-suite/FAIL_penny-bot_6.0_BuildSwiftPackage.log

Ignore the other failures on this bot, seems we've caught an unrelated issue in the compiler I will look into, but the error on penny bot seems specific to this update

@MahdiBM
Copy link
Contributor Author

MahdiBM commented Feb 2, 2025

@justice-adams-apple another try please 🙂

@justice-adams-apple
Copy link
Collaborator

@swift-ci test

@justice-adams-apple
Copy link
Collaborator

@MahdiBM Seeing:

error: let '_emptyDequeStorage' is not concurrency-safe because non-'Sendable' type 'ManagedBuffer<_DequeBufferHeader, Void>' may have shared mutable state

@MahdiBM
Copy link
Contributor Author

MahdiBM commented Feb 9, 2025

@justice-adams-apple Looks like an error in swift-collections:
https://ci.swift.org/job/swift-PR-source-compat-suite-test-macOS/321/artifact/swift-source-compat-suite/FAIL_penny-bot_6.0_BuildSwiftPackage.log

Click to expand errors
/Users/ec2-user/jenkins/workspace/swift-PR-source-compat-suite-test-macOS/swift-source-compat-suite/project_cache/penny-bot/.build/checkouts/swift-collections/Sources/DequeModule/_DequeBuffer.swift:44:14: error: let '_emptyDequeStorage' is not concurrency-safe because non-'Sendable' type 'ManagedBuffer<_DequeBufferHeader, Void>' may have shared mutable state
42 | /// The type-punned empty singleton storage instance.
43 | @usableFromInline
44 | internal let _emptyDequeStorage = _DequeBuffer<Void>.create(
   |              |- error: let '_emptyDequeStorage' is not concurrency-safe because non-'Sendable' type 'ManagedBuffer<_DequeBufferHeader, Void>' may have shared mutable state
   |              |- note: add '@MainActor' to make let '_emptyDequeStorage' part of global actor 'MainActor'
   |              `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
45 |   minimumCapacity: 0,
46 |   makingHeaderWith: { _ in

Swift.ManagedBuffer:1:12: note: generic class 'ManagedBuffer' does not conform to the 'Sendable' protocol
1 | open class ManagedBuffer<Header, Element> where Element : ~Copyable {
  |            `- note: generic class 'ManagedBuffer' does not conform to the 'Sendable' protocol
2 |     final public var header: Header
3 |     @inlinable deinit
/Users/ec2-user/jenkins/workspace/swift-PR-source-compat-suite-test-macOS/swift-source-compat-suite/project_cache/penny-bot/.build/checkouts/swift-collections/Sources/HashTreeCollections/HashNode/_HashNode+Storage.swift:29:14: error: let '_emptySingleton' is not concurrency-safe because non-'Sendable' type '_RawHashStorage' (aka 'ManagedBuffer<_HashNodeHeader, _RawHashNode>') may have shared mutable state
 27 | /// clean up after themselves in their `deinit` method.)
 28 | @usableFromInline
 29 | internal let _emptySingleton: _RawHashStorage = _RawHashStorage.create(
    |              |- error: let '_emptySingleton' is not concurrency-safe because non-'Sendable' type '_RawHashStorage' (aka 'ManagedBuffer<_HashNodeHeader, _RawHashNode>') may have shared mutable state
    |              |- note: add '@MainActor' to make let '_emptySingleton' part of global actor 'MainActor'
    |              `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
 30 |   minimumCapacity: 0,
 31 |   makingHeaderWith: { _ in _HashNodeHeader(byteCapacity: 0) })

Swift.ManagedBuffer:1:12: note: generic class 'ManagedBuffer' does not conform to the 'Sendable' protocol
1 | open class ManagedBuffer<Header, Element> where Element : ~Copyable {
  |            `- note: generic class 'ManagedBuffer' does not conform to the 'Sendable' protocol
2 |     final public var header: Header
3 |     @inlinable deinit
/Users/ec2-user/jenkins/workspace/swift-PR-source-compat-suite-test-macOS/swift-source-compat-suite/project_cache/penny-bot/.build/checkouts/jmespath.swift/Sources/JMESPath/Runtime.swift:23:24: error: static property 'builtInFunctions' is not concurrency-safe because it is nonisolated global shared mutable state
21 | 
22 |     private var functions: [String: JMESFunction.Type]
23 |     private static var builtInFunctions: [String: JMESFunction.Type] = [
   |                        |- error: static property 'builtInFunctions' is not concurrency-safe because it is nonisolated global shared mutable state
   |                        |- note: convert 'builtInFunctions' to a 'let' constant to make 'Sendable' shared state immutable
   |                        |- note: add '@MainActor' to make static property 'builtInFunctions' part of global actor 'MainActor'
   |                        `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
24 |         "abs": AbsFunction.self,
25 |         "avg": AvgFunction.self,

/Users/ec2-user/jenkins/workspace/swift-PR-source-compat-suite-test-macOS/swift-source-compat-suite/project_cache/penny-bot/.build/checkouts/jmespath.swift/Sources/JMESPath/Variable.swift:270:28: error: static property 'nsNumberBoolType' is not concurrency-safe because it is nonisolated global shared mutable state
268 |     }
269 | 
270 |     fileprivate static var nsNumberBoolType = type(of: NSNumber(value: true))
    |                            |- error: static property 'nsNumberBoolType' is not concurrency-safe because it is nonisolated global shared mutable state
    |                            |- note: convert 'nsNumberBoolType' to a 'let' constant to make 'Sendable' shared state immutable
    |                            |- note: add '@MainActor' to make static property 'nsNumberBoolType' part of global actor 'MainActor'
    |                            `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
271 | }

How should I proceed?

Options I'm thinking of:

  • File an issue in swift-collections to fix this.
  • File an issue in swift to revert the breaking change + Xfail penny-bot in nightly-mains?
  • Somehow do something in penny-bot to resolve these?

Worth noting swift-collections is still using swift-tools-version:5.7 ... I think the -Xswiftc -swift-version -Xswiftc 6 -Xswiftc build flags is making it compile with Swift 6 which it's not super ready for?

Could be worth an issue in swift-collections. I don't see any Swift 6 compatibility related issues.

@justice-adams-apple
Copy link
Collaborator

justice-adams-apple commented Feb 12, 2025

File an issue in swift-collections to fix this.

Yeah I'll file an issue and comment here. We should just fail it on this PR. Then I'll have this force merged. Thanks @MahdiBM !

@justice-adams-apple
Copy link
Collaborator

@shahmishal shahmishal merged commit 96b994a into swiftlang:main Feb 13, 2025
1 check failed
@justice-adams-apple
Copy link
Collaborator

@MahdiBM I'll open a PR tomorrow with the xfails once it goes through CI so I can see all config results and get the xfail nailed down accordingly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants